/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JanelaRelatorio.java
 *
 * Created on 03/06/2011, 14:11:46
 */

package GUI;

import dominio.Relatorio;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JEditorPane;
import javax.swing.JTextPane;

/**
 *
 * @author gilcemar e naliane
 */
public class JanelaRelatorio extends javax.swing.JFrame {
    private ControladorRelatorio controladorRelatorio;
    private ModeloParaComboBox modelo = new ModeloParaComboBox();
    public JTextPane getjTextPane1() {
        return jTextPane1;
    }

    
    public String getBotaoRelatorio() {
        return botaoRelatorio.getText();
    }

    public void setControladorRelatorio(ControladorRelatorio controladorRelatorio) {
        this.controladorRelatorio = controladorRelatorio;
        botaoRelatorio.addActionListener(this.controladorRelatorio);
    }

    public String getComboBoxAno() {
        return comboBoxAno.getSelectedItem().toString();
    }

    public void setComboBoxAno(String comboBoxAno) {
        this.comboBoxAno.setToolTipText(comboBoxAno);
    }

    public String getComboBoxMes() {
        return comboBoxMes.getSelectedItem().toString();
    }

    public void setComboBoxMes(String comboBoxMes) {
        this.comboBoxMes.setToolTipText(comboBoxMes);
    }

    /** Creates new form JanelaRelatorio */
    public JanelaRelatorio() {
        initComponents();
    }


    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        botaoRelatorio = new javax.swing.JButton();
        comboBoxMes = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        comboBoxAno = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextPane1 = new javax.swing.JTextPane();

        setTitle("Janela Relatório");

        jLabel1.setText("Mês");

        botaoRelatorio.setText("Gerar Relatório");

        comboBoxMes.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Selecione ...", "01", "02", "03", "04", "05", "06","07","08","09","10","11","12" }));

        jLabel2.setText("Ano");

        jScrollPane1.setViewportView(jTextPane1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 621, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboBoxMes, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboBoxAno, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botaoRelatorio)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(103, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(comboBoxMes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botaoRelatorio)
                    .addComponent(comboBoxAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(42, 42, 42)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 458, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        for (String ano:modelo.encontraAnosDosConsorcios())
        {
            comboBoxAno.addItem(ano);
        }

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botaoRelatorio;
    private javax.swing.JComboBox comboBoxAno;
    private javax.swing.JComboBox comboBoxMes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextPane jTextPane1;
    // End of variables declaration//GEN-END:variables

}
